package com.leetcode.August;

import javax.swing.tree.TreeNode;

/**
 * @Description: 226. 翻转二叉树
 * @Author: Mr.Fxy
 * @CreateTime: 2024-08-29 21:05
 */
public class LC226翻转二叉树 {
    public TreeNode invertTree(TreeNode root) {
        if (root == null) return null;
        invertTree(root.left);
        invertTree(root.right);
        TreeNode temp = root.left;
        root.left = root.right;
        root.right = temp;
        return root;
    }
}
